<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>搜索框</title>
    <style>
        *{padding: 0;margin: 0;}
        .g-search{
            border: 1px solid red;
            height: 40px;
            background-color: red;
            
            display: flex;
            align-items: center;
        }
        .g-search h2{
            width: 60px;
            text-align: center;
            color: white;
            font-size: 16px;
        }
        .g-search input{
            flex-grow: 1;
            border: none;
            outline: none;
            height: 30px;
            border-radius: 8px;
            text-indent: 5px;
        }
    </style>
</head>
<body>
    <div class="g-search">
        <h2>城市</h2>
        <input type="text" placeholder="请输入搜索内容"/>
        <h2>登录</h2>
    </div>
</body>
</html>